#include <REGX52.H>
#include "delay.h"
//#include "Timer.h"
int tab1[]={0x01,0x02,0x04,0x08};
unsigned char tab2[]={0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};

//	unsigned int i;

void main()
{
	int i,a;
//	Timer0Init16(0x4c,0x00);
	for(i=1234;i<9999;i++)
	{
		a=i;
		
		P0=0xff-tab2[a/1000];
	  P2=tab1[0];
		Delay(15);
		P2=0;
		
		a%=1000;
		P0=0xff-tab2[a/100];
	  P2=tab1[1];
		Delay(15);
		P2=0;
		
		a%=100;
		P0=0xff-tab2[a/10];
	  P2=tab1[2];
		Delay(15);
		P2=0;
		
		a%=10;
		P0=0xff-tab2[a];
	  P2=tab1[3];
    Delay(15);
		P2=0;
	}

}



//void Timer0() interrupt 0
//{
//	unsigned char count;

//	if(count<2)
//	{
//		i++;
//	}
//	TH0=0x4c;
//	TL0=0x00;
//	TR0=1;
//	if(i==9999)
//	{
//		TR0=0;
//	}
//}